<!--<div class="smart-widget">-->
<!--<div class="smart-widget-header">-->
<!--关联地图-->
<!--</div>-->
<!--<div class="smart-widget-inner">-->
<!--<div class="smart-widget-body">-->
<!--<div class="row">-->
<!--<div class="padding-md">-->
<!--<div class="row">-->
<!--<div class="col-md-5">-->
<!--<div class="smart-widget">-->
<!--<div class="smart-widget-inner">-->
<!--<div class="smart-widget-body">-->

<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="col-md-7">-->
<!--<div class="smart-widget">-->
<!--<div class="smart-widget-inner">-->
<!--<div class="smart-widget-body">-->

<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>&lt;!&ndash; ./row &ndash;&gt;-->
<!--</div>-->
<!--</div>&lt;!&ndash; ./smart-widget-inner &ndash;&gt;-->
<!--</div>&lt;!&ndash; ./smart-widget &ndash;&gt;-->


<div class="row">
    <div class="col-md-5">
        <div class="smart-widget">
            <div class="smart-widget-header">
                关联信息
            </div>
            <div class="smart-widget-inner">
                <div class="smart-widget-body">
                    <form id="roleAddForm" method="post"
                          class="form-horizontal  form-label-left" action="target.php">

                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3 col-xs-12"
                                   for="roleName">名称:
                            </label>
                            <div class="col-md-9 col-sm-6 col-xs-12">
                                <input type="text" id="roleName" name="roleName"
                                       required="required"
                                       oninvalid="setCustomValidity('请输入地图名称');"
                                       class="form-control col-md-7 col-xs-12"/>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="url" class="control-label col-md-2 col-sm-3 col-xs-12">URL:</label>
                            <div class="col-md-9 col-sm-6 col-xs-12">
                                <input type="text" id="url" name="url" required="required"
                                       oninvalid="setCustomValidity('请输入URL');"
                                       class="form-control col-md-7 col-xs-12"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="application"
                                   class="control-label col-md-2 col-sm-3 col-xs-12">应用:</label>
                            <div class="col-md-9 col-sm-6 col-xs-12">
                                <input type="text" id="application" name="application"
                                       required="required"
                                       oninvalid="setCustomValidity('请输入应用');"
                                       class="form-control col-md-7 col-xs-12"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="theServer"
                                   class="control-label col-md-2 col-sm-3 col-xs-12">服务器:</label>
                            <div class="col-md-9 col-sm-6 col-xs-12">
                                <input type="text" id="theServer" name="theServer"
                                       required="required"
                                       oninvalid="setCustomValidity('请输入服务器');"
                                       class="form-control col-md-7 col-xs-12"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="url" class="control-label col-md-2 col-sm-3 col-xs-12">中心点坐标:</label>
                            <div class="col-md-9 col-sm-6 col-xs-12">
                                <label for="longitude"
                                       class="control-label col-md-2 col-sm-3 col-xs-12"
                                       style="text-align: left;margin-left: -15px;padding-left: -15px">经度</label>
                                <div class="col-md- col-sm-4 col-xs-12">
                                    <input type="text" id="longitude" name="longitude"
                                           required="required"
                                           oninvalid="setCustomValidity('请输入经度');"
                                           class="form-control col-md-7 col-xs-12"/>
                                </div>
                                <label for="latitude"
                                       class="control-label col-md-2 col-sm-3 col-xs-12"
                                       style="text-align: left">纬度</label>
                                <div class="col-md-4 col-sm-6 col-xs-12">
                                    <input type="text" id="latitude" name="latitude"
                                           required="required"
                                           oninvalid="setCustomValidity('请输入纬度');"
                                           class="form-control col-md-7 col-xs-12"/>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="middle-name"
                                   class="control-label col-md-2 col-sm-3 col-xs-12"
                                   style="text-align:left">地图服务描述:</label>
                            <div class="col-md-9 col-sm-6 col-xs-12">
                    <textarea id="middle-name" class="form-control col-md-7 col-xs-12" name="middleName"
                              required="required" oninvalid="setCustomValidity('请输入地图服务描述');"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                <button type="submit" onclick="save()" id="validateBtn" class="btn btn-primary">保存
                                </button>
                                <button class="btn btn-primary" onclick="reset()" id="resetBtn" type="button">重置
                                </button>
                                <button id="back" onclick="backToList()" class="btn btn-success" type="button">返回
                                </button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-7">
        <div class="smart-widget">
            <div class="smart-widget-header">
                地图
            </div>
            <div class="smart-widget-inner">
                <div class="smart-widget-body">

                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        $('#roleAddForm').bootstrapValidator({
//        live: 'disabled',
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            submitHandler: function (form) {
                $("#validateBtn").ajaxSubmit({
                    success: function (d) {
                        if (d == -1) {
                            alert("系统错误，请再试或联系系统管理员！");
                            return false;
                        } else {
//                            if ($.isEmptyObject($("#people_id").val())) {
//                                alert("新增成功！");
//
//                            } else {
//                                alert("修改成功！");
//                            }
                            $('#validateBtn').attr("disabled", "disabled");
                            _query(1);
                        }
                    }
                });

            },
            fields: {  //startTimeToDate
                roleName: {
                    validators: {
                        notEmpty: {
                            message: '请输入名称'
                        }
                    }
                },
                url: {
                    validators: {
                        notEmpty: {
                            message: '请输入url'
                        }
                    }
                },
                application: {
                    validators: {
                        notEmpty: {
                            message: '请输入应用'
                        }
                    }
                },
                theServer: {
                    validators: {
                        notEmpty: {
                            message: '请输入服务器'
                        }
                    }
                },
                middleName: {
                    validators: {
                        notEmpty: {
                            message: '请编写服务描述'
                        }
                    }
                },
                longitude: {
                    validators: {
                        notEmpty: {
                            message: '请输入经度'
                        }
                    }
                },
                latitude: {
                    validators: {
                        notEmpty: {
                            message: '请输入纬度'
                        }
                    }
                }

            }
        });

        // Validate the form manually
        $('#validateBtn').click(function () {
            $('form').bootstrapValidator('validate');

        });
        $('#resetBtn').click(function () {
            $('form').data('bootstrapValidator').resetForm(true);
        });
    });
</script>